package book;

public class BookList {
    private Book[] books = new Book[10];
    private int useSize;

    public BookList() {
        books[0] = new Book("三国演义","罗贯中",56,"小说");
        books[1] = new Book("西游记","吴承恩",78,"小说");
        books[2] = new Book("红楼梦","曹雪芹",55,"小说");
        useSize = 3;

    }

    //获取下标为pos下的书
    public Book getBook(int pos) {
        return books[pos];

    }
    //在pos下标处放入一本书
    public void setBooks(int pos,Book book) {

        books[pos] = book;
    }
    //获取书本数量
    public int getUseSize() {
        return useSize;
    }
    //更改书本数量
    public void setUseSize(int size) {
        useSize = size;
    }

}
